select nkassierabrechnr, sum((FEINZELTARIF*nbuchungsfaktor)) as montant, nkassierid
                    from 
                    TABKASSATRANSAKT t
                    inner join
                    TABKASSABLOCKSATZ b
                    ON concat(t.nprojnr,concat(concat('-',t.nkassanr),concat('-',t.ntransnr)))= concat(b.nprojnr,concat(concat('-',b.nkassanr),concat('-',b.ntransnr)))
                    inner join
                    TABKASSATRANSAKTART a
                    on b.ntransaktart = a.nkassatransaktartnr
                    where t.nkassanr = '109' and t.dtausgabedat > '01/09/2014' 
                    group by t.nkassierabrechnr,t.nkassierid
        order by t.nkassierabrechnr desc;

select nkassierid, TO_CHAR(dtupdate, 'YYYY/MM/DD') as datetransac, sum(fgesamtpreis) as montant 
from tabkassatransakt where nkassanr = '57' and TO_CHAR(dtupdate, 'YYYY/MM/DD') > '2015/01/01' 
group by TO_CHAR(dtupdate, 'YYYY/MM/DD'),nkassierid;

select nkassierabrechnr, sum((FEINZELTARIF*nbuchungsfaktor)) as Montant, nkassierid, TO_CHAR(t.dtausgabedat, 'YYYY/MM/DD') as Madate, t.ngrundbezartnr, t.nkundenbezartnr, def.szname 
from TABKASSATRANSAKT t inner join TABKASSABLOCKSATZ b ON concat(t.nprojnr,concat(concat('-',t.nkassanr),concat('-',t.ntransnr)))= concat(b.nprojnr,concat(concat('-',b.nkassanr),concat('-',b.ntransnr))) 
inner join TABKASSATRANSAKTART a on b.ntransaktart = a.nkassatransaktartnr inner join TABKUNDENBEZAHLARTENDEF def on t.ngrundbezartnr * t.nkundenbezartnr = def.ngrundbezartnr * def.nkundenbezartnr 
where t.nkassanr = '57' group by t.ngrundbezartnr, t.nkassierabrechnr,TO_CHAR(t.dtausgabedat, 'YYYY/MM/DD'),t.nkassierid, t.nkundenbezartnr,def.SZNAME order by t.nkassierabrechnr desc;

select A.FK_SOCIETE, FK_ETABLISSEMENT,a.fk_centralisateur, A.FK_COMPTE , A.FK_AXE0 , A.FK_AXE1 , A.FK_AXE2 , A.FK_AXE3 , A.FK_AXE4 ,  A.FK_AXE5 ,  A.FK_AXE6 ,  A.FK_AXE7 ,  A.FK_AXE8 ,A.FK_AXE9  , A.FK_RUBRIQUE , CASE when SENS = '1' then sum(MONTANT_ANA_MONNAIE1*SENS) else 0 end as SOLDE_DEBIT_MONNAIE1, 
 CASE when SENS = '-1' then sum(MONTANT_ANA_MONNAIE1*(-SENS)) else 0 end as SOLDE_CREDIT_MONNAIE1, '<§P_DDPE>', '<§P_DFPE>' ,zppcg151
 FROM FI_GEN_ECRITURE_ANALYTIQUE A, FI_GEN_PLAN_COMPTABLE B 
 WHERE A.FK_SOCIETE = '<§P_CSTE>'
  and DATE_COMPTABLE between to_date('<§P_DDPE>','yyyymmdd') and to_date('<§P_DFPE>','yyyymmdd')
  and (fK_classe_ecriture is null or fk_classe_ecriture<'IFRS')      
and FK_CENTRALISATEUR = UK_NUMERO_COMPTE
and CODE_PARAM_CODE = '<§code_parametrage>'
and zppcg151 is not null and zppcg151 <> 'INV'
and substr(fk_centralisateur,1,1) between '6' and '7'
group by A.FK_SOCIETE , A.FK_eTABLISSEMENT, zppcg151, A.FK_COMPTE , A.FK_AXE0 ,  A.FK_AXE1 , A.FK_AXE2 , A.FK_AXE3 , A.FK_AXE4 ,  A.FK_AXE5 ,  A.FK_AXE6 ,  A.FK_AXE7 ,  A.FK_AXE8, A.FK_AXE9 , A.FK_RUBRIQUE ,  '<§P_DDPE>', '<§P_DFPE>' ,SENS ,fk_centralisateur;

select nkassierabrechnr, sum((FEINZELTARIF*nbuchungsfaktor)) as Montant, nkassierid, TO_CHAR(t.dtausgabedat, 'YYYY/MM/DD') as Madate, t.ngrundbezartnr as idta1, t.nkundenbezartnr as idta2, def.szname 
from TABKASSATRANSAKT t inner join TABKASSABLOCKSATZ b ON concat(t.nprojnr,concat(concat('-',t.nkassanr),concat('-',t.ntransnr)))= concat(b.nprojnr,concat(concat('-',b.nkassanr),concat('-',b.ntransnr))) 
inner join TABKASSATRANSAKTART a on b.ntransaktart = a.nkassatransaktartnr inner join TABKUNDENBEZAHLARTENDEF def on t.ngrundbezartnr * t.nkundenbezartnr = def.ngrundbezartnr * def.nkundenbezartnr 
group by t.ngrundbezartnr, t.nkassierabrechnr,TO_CHAR(t.dtausgabedat, 'YYYY/MM/DD'),t.nkassierid, t.nkundenbezartnr,def.SZNAME 
Having sum((FEINZELTARIF*nbuchungsfaktor)) <> 0 order by t.nkassierabrechnr desc;